/*************************************************************************
	> File Name: uart.h
	> Author: yuarmy
	> Mail: yuarmy@126.com 
	> Created Time: Sun 03 Aug 2014 05:29:06 AM PDT
 ************************************************************************/

#ifndef SHDEV_UART_H_
#define SHDEV_UART_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "shdevmag.h"
#define SERIAL_5N1 0x00
#define SERIAL_6N1 0x02
#define SERIAL_7N1 0x04
#define SERIAL_8N1 0x06
#define SERIAL_5N2 0x08
#define SERIAL_6N2 0x0A
#define SERIAL_7N2 0x0C
#define SERIAL_8N2 0x0E
#define SERIAL_5E1 0x20
#define SERIAL_6E1 0x22
#define SERIAL_7E1 0x24
#define SERIAL_8E1 0x26
#define SERIAL_5E2 0x28
#define SERIAL_6E2 0x2A
#define SERIAL_7E2 0x2C
#define SERIAL_8E2 0x2E
#define SERIAL_5O1 0x30
#define SERIAL_6O1 0x32
#define SERIAL_7O1 0x34
#define SERIAL_8O1 0x36
#define SERIAL_5O2 0x38
#define SERIAL_6O2 0x3A
#define SERIAL_7O2 0x3C
#define SERIAL_8O2 0x3E

int32_t InitUartTerm(SHDEVMANAGE_T *shdev);
int32_t ReadFromUart(SHDEVMANAGE_T *shdev, uint8_t* buff, int32_t size);
int32_t WriteToUart(SHDEVMANAGE_T *shdev, uint8_t* buff, int32_t size);
int32_t DeinitUartTerm(SHDEVMANAGE_T *shdev);
#ifdef __cplusplus
}
#endif
#endif //  SHDEV_UART_H_
